# from __future__ import absolute_import, unicode_literals
# from mydjango import settings
# from celery import shared_task
# import os
#
# # from celery import Celery
#
# # set the default Django settings module for the 'celery' program.
# # 只要是想在自己的脚本中访问Django的数据库等文件就必须配置Django的环境变量
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mydjango.settings')
#
# # app = Celery('mydjango', namespace='CELERY',broker='amqp://guest:guest@39.106.231.220:5672')
#
# # 配置celery
# # class Config:
# #     CELERY_RESULT_BACKEND = 'redis://123456@39.106.231.220:6379'
# #     CELERY_TIMEZONE = 'Asia/Shanghai'
#
# # app.config_from_object(Config ,namespace='CELERY')
#
# # Load task modules from all registered Django app configs.
# # app.autodiscover_tasks()
#
#
# @shared_task(bind=True)
# def debug_task(self):
#     print('Request: {0!r}'.format(self.request))
#
# # >celery -A mydjango.celery worker -l info
